<?php
    include('./config.php');
    include('./request.php');
    $arr = array();
    try{
        $pdo = new PDO($dsn,$user,$pass);
        $sql = "select * from user";
        $res = $pdo->prepare($sql);
        $res->execute();
        while($rea = $res->fetch(PDO::FETCH_ASSOC)){
            $temp = array('user_id'=>$rea['user_id'],'user_name'=>$rea['user_name'],'user_password'=>$rea['user_password'],'user_phone'=>$rea['user_phone'],'user_email'=>$rea['user_email']);
            array_unshift($arr,$temp);
        }
        echo json_encode($arr);
    }catch(PDOException $e){
        echo "error";
    }
?>